package com.xz.util;/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

//import com.google.gson.Gson;

import com.google.gson.Gson;
import com.xz.util.openplatform.DateTimeUtils;
import com.xz.util.openplatform.OpenVendorAuthModel;
import com.xz.util.openplatform.OpenVendorCryptographyUtils;

import java.time.LocalDateTime;

/**
 * /**
 *
 * @author li772
 */
public class OpenVendorPlatform {

    /**
     * @param
     */
    public static String openVendor(String vendorId,String secret) {
        // TODO code application logic here

        LocalDateTime now = LocalDateTime.of(2019, 9,
                24, 16, 0, 0);
        long time = DateTimeUtils.ToUnixTime(now);
        //1569340800
        /*String vendorId = "edfd27593cda409e9a749f170fbc73a4";
        String secret = "0f45f05461df446e8e18627d97f486a2";*/

        OpenVendorAuthModel model = OpenVendorCryptographyUtils.CreateAuthModel(vendorId, secret);

        Gson gson = new Gson();
        String json = gson.toJson(model);

        return json;
    }

}
